An example of a system modal dialog box is a password-protected screensaver. A system modal dialog box doesnt allow the user to do anything else in the Windows environment until he or she responds to it.
Nonmodal dialog boxes are simply forms that are displayed and can be left open. The user is allowed to shift focus to another part of the application. Examples are the toolbox and the Project window in Visual Basic. These boxes stay active while youre working within Visual Basic, and you can go to other parts of the Visual Basic IDE.
MsgBox
MsgBox can be used as both a statement and a function. When used as a statement, you present information to the user. This could be used to communicate information about an error that has occurred or an informational message about mail arriving in the inbox.
The MsgBox dialog box has five arguments you can pass to it: the message to display to the user, the icon/buttons to display in the dialog box, the title for the dialog box, the Help files name, and the Help context ID.
MsgBox "Press the Enter key to continue..."
MsgBox "Hello World", vbExclamation, "Hello"
The second parameter is generally one or more constants that are added together to create both an icon and the buttons on the message box. Table 11.1 shows you the constant to use for the different icons.
Table 11.1 Constants for the Second Parameter of the MsgBox Statement.